<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

<ui:composition template="/templates/modeloGeral.xhtml">
	<ui:define name="metadata">
		<f:metadata>
			<f:event listener="#{servicosBean.carregar}" type="preRenderView" />
		</f:metadata>
	</ui:define>
	<ui:define name="conteudo">

		<h:form>
			<p:toolbar>
				<f:facet name="left">
					<h:outputText value="Serviços" />
				</f:facet>
			</p:toolbar>

			<p:dataTable emptyMessage="Nenhum registro encontrado."
				value="#{servicosBean.listaServicos}"
				filteredValue="#{servicosBean.listaServicosFiltrados}"
				var="servicos" rows="13" paginator="true">
				
				<f:facet name="footer">
					<p:button value="Novo" outcome="/pages/servicosCadastro.xhtml">
					<f:param name="servacao" value="Novo"/>
					</p:button>
				</f:facet>
				<p:column headerText="Código">
					<h:outputText value="#{servicos.id}" />
				</p:column>
				<p:column headerText="Tipo" filterBy="#{servicos.tipo}"
					sortBy="#{servicos.tipo}">
					<h:outputText value="#{servicos.tipo}" />
				</p:column>
				<p:column headerText="Cadastrado por: ">
				</p:column>

				<p:column headerText="Opções">
				
					<p:button value="Excluir" outcome="/pages/servicosCadastro.xhtml">
					<f:param name="servacao" value="Excluir"/>
					<f:param name="servcod" value="#{servicos.id}"/>
					</p:button>
					
					<p:button value="Editar" outcome="/pages/servicosCadastro.xhtml">
					<f:param name="servacao" value="Editar"/>
					<f:param name="servcod" value="#{servicos.id}"/>
					</p:button>
					
				</p:column>

			</p:dataTable>

		</h:form>

	</ui:define>

</ui:composition>

</html>